package com.svse.designPattern.structure.adapter;

import com.svse.designPattern.structure.adapter.adapter.AdapteeRealize;
import com.svse.designPattern.structure.adapter.adapter.TargetRealize;
import com.svse.designPattern.structure.adapter.adapter.TwoWayAdapter;
import com.svse.designPattern.structure.adapter.service.TwoWayAdaptee;
import com.svse.designPattern.structure.adapter.service.TwoWayTarget;

/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Copyright 上海危网信息科技有限公司版权所有
 * @company wwsoft
 * @Date 2020/7/31 9:37
 */
public class TwoWayAdapterTest {
    public static void main(String[] args) {
        System.out.println("目标通过双向适配器访问适配者：");
        TwoWayAdaptee adaptee=new AdapteeRealize();
        TwoWayTarget target=new TwoWayAdapter(adaptee);
        target.request();
        System.out.println("-------------------");
        System.out.println("适配者通过双向适配器访问目标：");
        target=new TargetRealize();
        adaptee=new TwoWayAdapter(target);
        adaptee.specificRequest();
    }
}
